package com.cn.init;

import com.cn.entity.User;
import com.cn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;

/**
 * Created by chenyuncong on 2019/3/29.
 */
public class Init implements CommandLineRunner {

      @Autowired
      UserService userService;

      @Override
      public void run(String... args) throws Exception {

            userService.setUser("1",new User("carlos",18));
            userService.setUser("2",new User("lisa",19));
            userService.setUser("3",new User("mike",17));
            userService.setUser("4",new User("tom",16));
            userService.setUser("5",new User("amy",15));

          }

}
